<?php


class TagController extends CommonController{

	private $model;
	private $tags;
	public function __init(){
		$this->model = K('Tag');
		$this->tags = $this->model->getData();
	}
	//标签列表
	public function index(){
		$this->assign('tags',$this->tags);
		$this->display();
	}
	//添加标签
	public function add(){
		if(IS_POST){
			if($this->model->addData()){
				$this->success('添加成功','index');
			}else{
				$this->error('添加失败');
			}
		}else{
			$this->display();
		}
	}
	//编辑标签
	public function edit(){
		
	}
	//删除
	public function del(){

	}
}
?>